using Andromeda.Global.Business.DataObject;
using ForgeIt.Dal.dbo;
using System;

using System.Collections.Generic;
using System.Linq;
using Andromeda.Global.Data;

namespace ForgeIt.Business.Stub
{
	public abstract class EntityStub : DataObjectModelBase
	{
		#region private fields


		private DBEntity foDBEntity;


		#endregion private fields
    
		#region public constructors

		protected EntityStub()
			: this(new DBEntity())
		{
		}

		#endregion public constructors
    

		#region internal constructors

		internal EntityStub(DBEntity foDBEntity)
		{

			this.foDBEntity = foDBEntity;

		}

		#endregion internal constructors
  

		#region protected datasource properties
		

		internal DBEntity DB_DBEntity
		{
			get { return foDBEntity ?? (foDBEntity = new DBEntity()); }
		}

		
		public override DataConnectorCollection DataObjects
		{
			get
			{
				return new DataConnectorCollection { foDBEntity } ;
			}
		}

		

		/// 
		///
		/// 
		public int IdEntity
		{
			get { return DB_DBEntity.IdEntity; }

		}

		/// 
		///
		/// 
		public string Name
		{
			get { return DB_DBEntity.Name; }

			set { DB_DBEntity.Name = value; }

		}

		/// 
		///
		/// 
		public string Nickname
		{
			get { return DB_DBEntity.Nickname; }

			set { DB_DBEntity.Nickname = value; }

		}

		/// 
		///
		/// 
		public byte[] ImageBinary
		{
			get { return DB_DBEntity.ImageBinary; }

			set { DB_DBEntity.ImageBinary = value; }

		}

		/// 
		///
		/// 
		public System.DateTime CreatedAt
		{
			get { return DB_DBEntity.CreatedAt; }

			set { DB_DBEntity.CreatedAt = value; }

		}

		/// 
		///
		/// 
		public System.DateTime ModifiedAt
		{
			get { return DB_DBEntity.ModifiedAt; }

			set { DB_DBEntity.ModifiedAt = value; }

		}

		#endregion protected datasource properties
    
		#region protected datasource foreign key properties
    

  
		#endregion protected datasource foreign key properties
    
		#region protected datasource external key properties
    

  
		#endregion protected datasource external key properties
    
		#region properties
    

		#endregion properties
    
		#region methods methods

		#endregion methods

        #region Static Factories

        public static Entity GetEntity(int foIdEntity)
        {
          return new Entity(DBEntity.GetEntity(foIdEntity));
        }
  
        public static IEnumerable<Entity> ListEntity()
        {
            return (from DBEntity entity in DBEntity.ListEntity() select new Entity(entity));
        }
        
  
        public static IEnumerable<Entity> ListEntity(object foIdEntity, object foName, object foNickname, object foImageBinary, object foCreatedAt, object foModifiedAt)
        {
            return (from DBEntity entity in DBEntity.ListEntity(foIdEntity, foName, foNickname, foImageBinary, foCreatedAt, foModifiedAt) select new Entity(entity));
        }
        
        #endregion Static List Methods

	
  }
}